CPPFLAGS := $(CPPFLAGS) -g -I../include
LDFLAGS := $(LDFLAGS) -lbfd

TESTS = \
	jmem-test-c \
	jmem-test-cpp \
	jmem-test-leak-c \
	jmem-test-multiple-free-c \
	jmem-test-multiple-free-cpp

all: $(TESTS)

$(TESTS): $(wildcard ../include/*.h)

%: %.c
	@(echo -e 'CC\t$<')
	@($(CC) $(CPPFLAGS) $(CFLAGS) $< $(LDFLAGS) -o $@)

%: %.cpp
	@(echo -e 'CXX\t$<')
	@($(CXX) $(CPPFLAGS) $(CXXFLAGS) $< $(LDFLAGS) -o $@)

clean:
	rm -f $(TESTS)
